package com.kscrm.web.service.impl;

import java.util.List;

import com.kscrm.common.utils.SecurityUtils;
import com.kscrm.web.domain.FollowUp;
import com.kscrm.web.mapper.FollowUpMapper;
import com.kscrm.web.service.IFollowUpService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 客户跟进记录Service业务层处理
 *
 * @author Dhq
 * @date 2025-02-10
 */
@Service
public class FollowUpServiceImpl implements IFollowUpService {
    @Autowired
    private FollowUpMapper followUpMapper;

    /**
     * 查询客户跟进记录
     *
     * @param id 客户跟进记录主键
     * @return 客户跟进记录
     */
    @Override
    public FollowUp selectFollowUpById(Long id) {
        return followUpMapper.selectFollowUpById(id);
    }

    /**
     * 查询客户跟进记录列表
     *
     * @param followUp 客户跟进记录
     * @return 客户跟进记录
     */
    @Override
    public List<FollowUp> selectFollowUpList(FollowUp followUp) {
        return followUpMapper.selectFollowUpList(followUp);
    }

    /**
     * 新增客户跟进记录
     *
     * @param followUp 客户跟进记录
     * @return 结果
     */
    @Override
    public int insertFollowUp(FollowUp followUp) {
        followUp.setUserId(SecurityUtils.getUserId());
        return followUpMapper.insertFollowUp(followUp);
    }

    /**
     * 修改客户跟进记录
     *
     * @param followUp 客户跟进记录
     * @return 结果
     */
    @Override
    public int updateFollowUp(FollowUp followUp) {
        return followUpMapper.updateFollowUp(followUp);
    }

    /**
     * 批量删除客户跟进记录
     *
     * @param ids 需要删除的客户跟进记录主键
     * @return 结果
     */
    @Override
    public int deleteFollowUpByIds(Long[] ids) {
        return followUpMapper.deleteFollowUpByIds(ids);
    }

    /**
     * 删除客户跟进记录信息
     *
     * @param id 客户跟进记录主键
     * @return 结果
     */
    @Override
    public int deleteFollowUpById(Long id) {
        return followUpMapper.deleteFollowUpById(id);
    }
}
